package com.dapeis.api.controller.collocation;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.google.gson.JsonElement;

/**
 * 搭配师方案
 * @author asus
 *
 */
public interface IPlanController {
	/**
	 * 查看方案详细内容
	 * @param id
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/selectPlan" , method = RequestMethod.GET)
    @ResponseBody
    JsonElement selectPlan(Integer planId,HttpServletRequest request);
	
	/**
	 * 保存方案,存用户id ， 方案名 ， 搭配描述文字 ，主图 ，小图id
	 * @param collocationPlan
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/savePlan" , method = RequestMethod.POST, consumes = "multipart/form-data")
    @ResponseBody
    JsonElement savePlan (@RequestParam String planName,
    		@RequestParam String remark ,MultipartFile masterImage, @RequestParam String[] imgIds,Integer publish,
    HttpServletRequest request)  throws Exception ;
	
	/**
	 * 删除方案
	 * @param planId
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/deletePlan" , method = RequestMethod.POST)
    @ResponseBody
	JsonElement deletePlan(@RequestParam Integer planId , HttpServletRequest request);
	
	/**
	 * 方案列表
	 * @param p
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/list")
    @ResponseBody
	JsonElement list(@RequestParam(required = false) Integer p , HttpServletRequest request);
	
	/**
	 * 草稿箱列表
	 * @param p
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/darftList")
    @ResponseBody
	JsonElement darftList(@RequestParam(required = false) Integer p , HttpServletRequest request);
	
}
